package com.yxm.springbootsecurity.service;

import com.yxm.springbootsecurity.dao.UserDao;
import com.yxm.springbootsecurity.entity.UserEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author CC11001100
 * @date 2017/10/7 3:13
 * @email CC11001100@qq.com
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    public List<UserEntity> login(String username, String password){
//        String hashPasswd = DigestUtils.md5Hex(passwd.charAt(0) + passwd + passwd.charAt(passwd.length()-1));
        return userDao.find(username, password);
    }
    public List<UserEntity> account(String account){
//        String hashPasswd = DigestUtils.md5Hex(passwd.charAt(0) + passwd + passwd.charAt(passwd.length()-1));
        return userDao.find(account);
    }
    public List<UserEntity> security(String account){
//        String hashPasswd = DigestUtils.md5Hex(passwd.charAt(0) + passwd + passwd.charAt(passwd.length()-1));
        return userDao.security(account);
    }


}
